package com.west.imclient.handler.impl;

import java.util.Map;

import javax.swing.JTextArea;
import javax.swing.JTextPane;

import com.west.imclient.RxBus;
import com.west.imclient.handler.IHandler;
import com.west.imclient.view.MeetingRoomView;

import imserverentity.entity.IChattable;
import imserverentity.entity.impl.Client;


public class ChatHandler implements IHandler{
	private Map<String, Object> params;
	private MeetingRoomView meetingRoomView;
	
	public ChatHandler(Map<String, Object> params, MeetingRoomView meetingRoomView) {
		this.params = params;
		this.meetingRoomView = meetingRoomView;
	}
	
	public void handle() {
		IChattable from = (IChattable) params.get("from");
		String to = (String) params.get("to");
		String content = (String) params.get("content");
//		JTextPane jtp = meetingRoomView.getJtp();
//		jtp.setText(jtp.getText()+ "\n" + ((Client) from).getAccount() + " to " + to + "\n" + content);
//		JTextArea jta = meetingRoomView.getJta();
		
//		jta.setText("");
		System.out.println(content);
		RxBus.get().post(content);
	}

}
